﻿using System;
using System.Collections.Generic;
using System.Text;
using NIIT.SaoBacDau.Aupi.HospitalManagement.Entities;
using System.Data.SqlClient;
using System.Data;

namespace NIIT.SaoBacDau.Aupi.HospitalManagement.DataAccess
{
    public class DAO_E_Beds
    {
        public static List<Report_Beds> InfBeds1()
        {
            SqlDataAdapter sqlda = new SqlDataAdapter("Report.ReportBeds1", DAO_ConnectDatabase.Connect());
            sqlda.SelectCommand.CommandType = CommandType.StoredProcedure;
            DataTable dtable = new DataTable();
            sqlda.Fill(dtable);
            List<Report_Beds> List = new List<Report_Beds>();
            foreach (DataRow dr in dtable.Rows)
            {
                Report_Beds bs = new Report_Beds();
                bs.DepartmentName = dr["NameDetails"].ToString();
                bs.TotalBeds = Convert.ToInt32(dr["TotalBeds"].ToString());
                List.Add(bs);
            }
            return List;
        }
        public static List<Report_Beds> InfBeds2()
        {
            SqlDataAdapter sqlda = new SqlDataAdapter("Report.ReportBeds2", DAO_ConnectDatabase.Connect());
            sqlda.SelectCommand.CommandType = CommandType.StoredProcedure;
            DataTable dtable = new DataTable();
            sqlda.Fill(dtable);
            List<Report_Beds> List = new List<Report_Beds>();
            foreach (DataRow dr in dtable.Rows)
            {
                Report_Beds bs = new Report_Beds();
                bs.TotalPatient = Convert.ToInt32(dr["TotalPatient"].ToString());
                List.Add(bs);
            }
            return List;
        }
    }
}
